package com.weibo.survey.service.impl;

import java.util.List;

import com.weibo.survey.dao.BaseDao;
import com.weibo.survey.service.BaseService;

public abstract class BaseServiceImpl<T> implements BaseService<T> {

	protected BaseDao<T> baseDao;

	public BaseDao<T> getBaseDao() {
		return baseDao;
	}

	public void setBaseDao(BaseDao<T> baseDao) {
		this.baseDao = baseDao;
	}

	@Override
	public void saveEntity(T t) {
		baseDao.saveEntity(t);
	}

	@Override
	public void updateEntity(T t) {
		baseDao.updateEntity(t);
	}

	@Override
	public void saveOrUpdateEnity(T t) {
		baseDao.saveOrUpdateEnity(t);
	}

	@Override
	public void deleteEntity(T t) {
		baseDao.deleteEntity(t);
	}

	@Override
	public void batchByHql(String hql, Object... objs) {
		baseDao.batchByHql(hql, objs);
	}

	@Override
	public T getEntity(int id) {
		return baseDao.getEntity(id);
	}

	@Override
	public T loadEntity(int id) {
		return baseDao.loadEntity(id);
	}

	@Override
	public T getEntityByHql(String hql, Object... objs) {
		return baseDao.getEntityByHql(hql, objs);
	}

	@Override
	public List<T> getEntitiesByHql(String hql, Object... objs) {
		return baseDao.getEntitiesByHql(hql, objs);
	}

}
